package cn.weichuyu.snippet.gccfb.entity;

import cn.weichuyu.snippet.gccfb.annotation.TargetConvertInfo;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Set;

@Getter
@Setter
public class TestRespDTO {
    //一个String对象
    @TargetConvertInfo
    private String code;

    //一个Date对象
    @TargetConvertInfo
    private Date transDate;

    //一个布尔对象
    @TargetConvertInfo
    private Boolean isHandle;

    //一个数值对象
    @TargetConvertInfo
    private BigDecimal amount;

    //一个动态内部类
    @TargetConvertInfo(isClassInnerNotStatic = false)
    private ContactInfoDTO contactInfo;

    //一个动态内部类数组，里面再套个动态内部类数组
    @TargetConvertInfo(isClassInnerNotStatic = true)
    private List<AreaDTO> areas;

    //一个静态内部类集合
    @TargetConvertInfo
    private Set<EmployeesDTO> employees;

    @Getter
    @Setter
    public static class ContactInfoDTO {
        @TargetConvertInfo
        private String webSite;
        @TargetConvertInfo
        private String name;
        @TargetConvertInfo
        private String url;
    }

    @Getter
    @Setter
    public static class AreaDTO {
        @TargetConvertInfo
        private String city;
        @TargetConvertInfo
        private List<ContactInfoDTO> contactInfos;
        @TargetConvertInfo
        private String province;
    }

    @Getter
    @Setter
    public static class EmployeesDTO {
        @TargetConvertInfo
        @JSONField(name = "Name")
        private String name;
        @TargetConvertInfo
        @JSONField(name = "Job")
        private String job;
        @TargetConvertInfo
        @JSONField(name = "KeyNo")
        private String keyNo;
    }
}
